/**   
 * @Title: TopImageCommunicater.java 
 * @Package com.esun.rabbit2.communicaters.lotteryhalltopmsg 
 * @Description: TODO(用一句话描述该文件做什么) 
 * @author: City Jiangsy@500wan.com   
 * @date: 2012-1-13 下午6:02:54  
 * Copyright: (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.rabbit2.communicaters.lotteryhalltopmsg;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.http.client.ClientProtocolException;
import org.xml.sax.SAXException;

import com.esun.config.BussinessCode;
import com.esun.config.Config;
import com.esun.config.Key;
import com.esun.network.ServerCommunicater;

/**
 * @ClassName: TopImageCommunicater
 * @Description: (购彩大厅顶部图片显示接口)
 * @author: City Jiangsy@500wan.com
 * @date: 2012-1-13 下午6:02:54
 * 
 */
public class TopImageCommunicater extends ServerCommunicater {
	private String msgServer; // 服务器信息
	private boolean isSucceed = false;

	public String getMsgServer() {
		return msgServer;
	}

	public void setMsgServer(String msgServer) {
		this.msgServer = msgServer;
	}

	public boolean isGetDetailSucced() throws ClientProtocolException, IOException, ParserConfigurationException, SAXException {
		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
		list.add(mapItem(BussinessCode.PASER_MID, BussinessCode.MID_TOP_IMAGE));
		// 写入服务器返回信息
		super.getServerResponse(list, true);
		setMsgServer(super.getErrorMSG());
		if (super.getState() == 100) {
			isSucceed = true;
		} else {
			isSucceed = false;
		}
		return isSucceed;
	}

	public boolean isShow() {
		boolean b = false;
		if (super.getResult().get(Key.KEY_ISSHOW).equals(Config.NUM1)) {
			b = true;
		}
		return b;
	}

	private HashMap<String, String> mapItem(String name, String value) {
		HashMap<String, String> map = new HashMap<String, String>();
		map.put(name, value);
		return map;
	}

}
